package com.yb.domain.goods;

import java.util.Iterator;
import java.util.List;

import com.yb.base.annotation.Column;
import com.yb.base.annotation.Table;
import com.yb.base.entity.BaseEntity;
import com.yb.util.framework.MemoryData;

@Table("t_g_market")
public class TgMarket extends BaseEntity {
	private String name;
	private Integer marketOrder;
	private String marketDesc;
	private String categoryId;
	@Column(name = "reject")
	private String categoryName;

	public String getCategoryName() {
		if (null == categoryId || "".equals(categoryId))
			return "暂无资料";
		categoryName = "";
		List<TgCategory> categoryList = MemoryData.getCategoryList();
		for (Iterator iterator = categoryList.iterator(); iterator.hasNext();) {
			TgCategory cate = (TgCategory) iterator.next();
			if ((","+categoryId+",").indexOf(","+cate.getId()+",")!=-1)
				categoryName += cate.getName()+" | ";
		}
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getMarketOrder() {
		return marketOrder;
	}

	public void setMarketOrder(Integer marketOrder) {
		this.marketOrder = marketOrder;
	}

	public String getMarketDesc() {
		return marketDesc;
	}

	public void setMarketDesc(String marketDesc) {
		this.marketDesc = marketDesc;
	}

}
